<template>
    <div>
        <el-breadcrumb separator-class="el-icon-arrow-right">
            <el-breadcrumb-item :to="{ path: '/welcome' }">    <i class="el-icon-location-information"></i>    首页</el-breadcrumb-item>
            <el-breadcrumb-item>权限管理</el-breadcrumb-item>
            <el-breadcrumb-item>权限列表</el-breadcrumb-item>
        </el-breadcrumb>
        <el-card>
            <el-table :data='rightsList' stripe border>
                <el-table-column type="expand">
                    <template slot-scope="scope">
                        {{scope.row}}
                    </template>
                </el-table-column>
                <el-table-column type="index"></el-table-column>
                <el-table-column label="权限名称" prop="authName"></el-table-column>
                <el-table-column label="路径" prop="path"></el-table-column>
                <el-table-column label="权限等级" prop="level">
                    <template slot-scope="scope">
                        <el-tag type="success" v-show="scope.row.level == 0">一级</el-tag>
                        <el-tag type="warning" v-show="scope.row.level == 1">二级</el-tag>
                        <el-tag type="info" v-show="scope.row.level == 2">三级</el-tag>
                    </template>
                </el-table-column>
            </el-table>
        </el-card>
    </div>
</template>

<script>
export default {
    data: function () {
        return {
            msg: '',
            rightsList: []
        }
    },
    created: function () {
        this.getRightsList()
    },
    methods: {
        getRightsList: function () {
            this.$http.get('rights/list').then(result => {
            console.log(result)
            if (result.data.meta.status !== 200) {
                this.$message.error('获取用户权限列表失败，请稍后重试！')
                return 0
            }
            this.rightsList = result.data.data
            console.log(this.rightsList)
        })
        }
    }
}
</script>

<style lang="less" scoped>
.el-breadcrumb{
     height: 43px;
     line-height: 43px;
     background-color: rgb(233, 238, 243);
     position:absolute;
     top: -43px;
     margin-left: 0;
     left: 0;
     padding-left: 25px;
     padding-right: 25px;
    //  transform: translateY(-30px);
    //  z-index: 999;
    .el-breadcrumb__separator {
    margin: 0 9px;
    font-weight: 700;
    color: #536da1!important;
    }
 }
</style>
